package org.bleep.input;

import org.lwjgl.input.Keyboard;

public class PushButton extends Button
{
	private boolean lastButtonState;
	
	public PushButton(String name, int keyCode)
	{
		super(name, keyCode);
		lastButtonState = false;
	}
	
	public boolean isActive()
	{
		boolean currentButtonState = Keyboard.isKeyDown(keyCode);
		boolean result = currentButtonState && !lastButtonState;
		lastButtonState = currentButtonState;
		return result;
	}
}